package com.weijian.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.weijian.common.BaseContext;
import com.weijian.dal.entity.Address;
import com.weijian.mapper.AddressMapper;
import com.weijian.service.AddressService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 服务实现类
 */
@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService {

    /**
     * 查询当前用户地址列表
     */
    @Override
    public List<Address> findMyAddresses() {
        Long currentId = BaseContext.getCurrentId();
        return lambdaQuery().eq(Address::getUserId, currentId).list();
    }
}
